package com.wgly.question.bean;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class Msg {
	private int code;
	private String msg;
	private List<Object> data= new ArrayList();
	public static Msg success() {
		Msg result = new Msg();
		result.setCode(1);
		result.setMsg("成功");
		return result;
	}
	public static Msg fail() {
		Msg result = new Msg();
		result.setCode(2);
		result.setMsg("失败");
		return result;
		
	}
	public int getCode() {
		return code;
	}
	public void setCode(int code) {
		this.code = code;
	}
	public String getMsg() {
		return msg;
	}
	public void setMsg(String msg) {
		this.msg = msg;
	}
	
   public List<Object> getData() {
		return data;
	}
	public void setData(List<Object> data) {
		this.data = data;
	}
	//	public Map<String, Object> getdata() {
//		return data;
//	}
//	public void setdata(Map<String, Object> data) {
//		this.data = data;
//	}
	public Msg add(Object value) {
		// TODO Auto-generated method stub
		this.getData().add(value);
		return this;
	}
	
}
